package extend;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Tree {

    public static void main(String[] args) {
        TreeNode xNode = new TreeNode("x", 18, "if(x>10){ return 20;}else{return 30;}", null);
        TreeNode yNode = new TreeNode("y", 28, "public void sayHello(){System.out.println(name)", null);


        TreeNode bNode = new TreeNode("b", 38, "x>10? age:age+10", Arrays.asList(xNode,yNode));




    }
}


@Data
@AllArgsConstructor
@NoArgsConstructor
class TreeNode{

    private String keyword;
    private int age;
    private String calcExpression;

    private List<TreeNode> children;
}
